package com.kly.controller;

import com.kly.common.BaseResponse;
import com.kly.common.ResultUtils;
import com.kly.exception.ErrorCode;
import com.kly.exception.ThrowUtils;
import com.kly.service.PictureCommentService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author admin
 * @date 2025/3/24
 */
@RequestMapping("/picture/comment")
@RestController
public class PictureCommentController {

    @Resource
    private PictureCommentService pictureCommentService;


    /**
     * 评论点赞
     */
    @PostMapping("/thumb")
    public BaseResponse<Boolean> doThumb(Long commentId) {
        ThrowUtils.throwIf(commentId == null, ErrorCode.PARAMS_ERROR);
        return ResultUtils.success(pictureCommentService.doThumb(commentId));
    }

}
